package com.inspur.sc.springboot.dao;


import com.inspur.sc.springboot.entity.SysPermission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface SysPermissionDao extends JpaRepository<SysPermission, Integer> {

    @Query(value = "select p.* from sys_permission p " +
            " LEFT JOIN sys_permission_group spg on p.id= spg.sys_permission_id " +
            " where spg.sys_group_id=?1", nativeQuery = true)
    List<SysPermission> findByGroupId(Integer groupId);

}
